/*
ID: guoxu1
PROG: milk3
LANG: C++
*/
#include <fstream>
#include <vector>
#include <set>
using namespace std;

#define cin fin
#define cout fout

struct Buckets
{
	int a[3];
	inline int hash()
	{
		return (a[2] << 10) + (a[1] << 5) + a[0];
	}
	bool pour( const Buckets& capacity, int i, int j )
	{
		if( a[i] != 0 && a[j] != capacity.a[j] )
		{
			int sum = a[i] + a[j];
			a[j] = std::min( sum, capacity.a[j] );
			a[i] = sum - a[j];
			return true;
		}
		return false;
	}
};

int main()
{
	ifstream fin( "milk3.in" );
	ofstream fout( "milk3.out" );

	Buckets capacity;
	cin >> capacity.a[0] >> capacity.a[1] >> capacity.a[2];
	Buckets init = capacity;
	init.a[0] = init.a[1] = 0;

	set<int> hashs;
	hashs.insert( init.hash() );
	vector<Buckets> tasks;
	tasks.push_back( init );
	size_t q = 0;
	while( q < tasks.size() )
	{
		Buckets& t = tasks[q];
		//A->B
		for( int i = 0; i < 3; i++ )
		for( int j = 0; j < 3; j++ )
		{
			if( i == j ) continue;
			Buckets n = t;
			if( !n.pour( capacity, i, j ) ) continue;
			set<int>::iterator it = hashs.find( n.hash() );
			if( it == hashs.end() )
			{
				tasks.push_back( n );
				hashs.insert( n.hash() );
			}
		}
		q++;
	}
	set<int> amounts;
	for( size_t i = 0; i < tasks.size(); i++ )
	{
		Buckets& t = tasks[i];
		if( t.a[0] == 0 )
		{
			amounts.insert( t.a[2] );
		}
	}
	bool first = true;
	for( set<int>::const_iterator it = amounts.begin(); it != amounts.end(); it++ )
	{
		if( !first ) cout << " ";
		first = false;
		cout << *it;
	}
	cout << endl;
	return 0;
}